package com.itheima.controller;

import com.itheima.pojo.UmsMemberLevel;
import com.itheima.service.UmsMemberLevelService;
import com.itheima.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/memberLevel")
public class UmsMemberLevelController {

    @Autowired
    private UmsMemberLevelService umsMemberLevelService;

    /**
     * 查询所有会员等级
     */
    @GetMapping("/list")
    public ResponseEntity list(@RequestParam Integer defaultStatus){
        List<UmsMemberLevel> umsMemberLevelList = umsMemberLevelService.list(defaultStatus);
        return ResponseEntity.ok(Result.success(umsMemberLevelList));
    }

}
